proc showfont:
 local a%,f$(128),fid%,i%(32)
 giprint "Showfont v1.0 by M.Schuster"
 f$="\fon\*.fon"
 do
  gcls
  dinit "Choose Font"
  dfile f$,"",0
  if dialog=0 :stop :endif
  fid%=gloadfont(f$)
  gfont fid%
  ginfo i%()
  a%=i%(1) :rem lowest char-code
  gat 0,i%(3)-i%(4)
  do
   gprint chr$(a%)
   if a%<255
    if gx>480-gtwidth(chr$(a%+1))
     if gy>160-i%(3)
      gscroll 0,-i%(3)-1
      gat 0,gy
     else
      gat 0,gy+i%(3)+1
     endif
    endif
   endif
   if key :giprint "Paused"+chr$(1) :get :endif
   a%=a%+1
  until a%>i%(2) :rem highest char-code
  giprint "Press a key"+chr$(1)
  get
  gunloadfont(fid%)
 until 0  
endp

